<?php

class clientBase
{
    private $server = "databases.aii.avans.nl";
    private $user = "nkapinga";
    private $password = "Ab12345";
    private $db = "nkapinga_db";
    private $link;
    
    public function __construct(){}
   
     // Initialise database
     public function connect()
     { 
        $this->link = mysql_connect($this->server, $this->user, $this->password);
        
        if (!$this->link) 
        {
            die('Could not connect: ' . mysql_error());
        }
        
        $db_selected = mysql_select_db($this->db, $this->link);
        if (!$db_selected) 
        {
            die ('Can\'t use db : ' . mysql_error());
        }
        return $this->link;
     }
     
     public function close()
     {
        mysql_close($this->link);
     }
}
?>